<?php
require_once('Excel/reader.php');         // 引用Excel/reader.php文件，加载类库
$reader = new Spreadsheet_Excel_Reader(); // 实例化解析类Spreadsheet_Excel_Reader
$reader->setOutputEncoding("CP1251");     // 设置编码方式
$reader->read("aaa.xls");   
error_reporting(E_ALL ^ E_NOTICE);
// ExcelFile($filename, $encoding);

// Set output Encoding.

//"data.xls"是指要导入到mysql中的excel文件
//$table_output[$sheet] .= nl2br(htmlspecialchars($data->sheets[$sheet]['cells'][$row][$col]));

for ($i = 2; $i <= $data->sheets[0]['numRows']; $i++)
 {
 for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) {
  echo "\"".$data->sheets[0]['cells'][$i][$j]."\"<br>,";
 }
 echo "\n";
 }

/*
require_once 'Excel/reader.php';
$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('UTF-8');
$data->read('aaa.xls');
$rs = $data -> getExcelResult();
print_r($rs);
*/
?>